import Vue from 'vue'
import Router from 'vue-router'
import lawyerIndex from '../components/lawyer/index.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {path: '/', name: 'lawyerIndex', component: lawyerIndex},
    {path: '/lawyers', name: 'lawyers', component: (resolve) => require(['../components/lawyer/lawyers.vue'], resolve)},
    {path: '/lawyerDetail/:id', name: 'lawyerDetail', component: (resolve) => require(['../components/lawyer/lawyerDetail.vue'], resolve)},
    {path: '/contract', name: 'contract', component: (resolve) => require(['../components/contract/contract.vue'], resolve)},
    {path: '/consult', name: 'consult', component: (resolve) => require(['../components/consult/consult.vue'], resolve)}
  ],
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
})
